import axios from "axios"
import { Message } from "element-ui";

export function view(row){
  axios.get('/user/preview/'+row.id).then((res)=>{
    if(res.data.code == 200)
    {
      var docName = res.data.data;           //获取预览文件名
      var url = 'http://1.14.48.193:8888/preview/'+docName;
      let Base64 = require('js-base64').Base64;
      window.open('http://1.14.48.193:5555/onlinePreview?url='+encodeURIComponent(Base64.encode(url)));
    }else{
      Message.error(res.data.data);
    }
  })
}
